from config import PLUGINS_PATH,  ALGORITHM
import sys
import os

class CAnn(object):
    
    def __init__(self,  net):
        self.layer = None
        self.net = net
        self.synapsis = None
        self.plugins = {}
    
        self.algorithm = None
        self.currentLayer = None
        self.numLayers = len(net.layers)
    
        self.error = 0
        
    def loadPlugins(self):
        path = PLUGINS_PATH
        sys.path.append(path)
        try:
            m = __import__(ALGORITHM)
            print dir(m)
            self.algorithm = m
        except:
            print "Error loading module "+ALGORITHM
